<?php

namespace App\Transformers\System;

use League\Fractal\TransformerAbstract;
use App\Models\System\User;

/**
 * Class UserTransformer
 * @package namespace App\Transformers\System;
 */
class UserTransformer extends TransformerAbstract{
    public function transform(User $model)
    {
        return [
            'id'                       => (int) $model->id,
            'name'                     =>$model->name,
            'major_department_name'    =>$model->major_department_name,
            'major_station_name'       =>$model->major_station_name,
            'wx_no'                    =>$model->wx_no,
            'phone'                    =>$model->phone,
            'account_status'           =>$model->account_status,
            'created_at'               => $model->created_at->format('Y-m-d H:i:s'),
            'updated_at'               => $model->updated_at->format('Y-m-d H:i:s')
        ];
    }
}
